<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <script type="text/javascript" src="http://lib.baomitu.com/jquery/1.12.4/jquery.js"></script>
</head>
<body>
登录
<form action="http://120.76.173.248:9999/auth/oauth/token" method="post">
    <input name="username" type="text" value="cs10000082">
    <br/>
    <input name="password" type="password" value="y1ha0_@##@aplus">
    <br/>
<!--    <input th:name="${_csrf.parameterName}" th:value="${_csrf.token}">-->

    <button type="submit">登录</button>

    <input type="hidden" name="scope" value="server">
    <input type="hidden" name="grant_type" value="password">

</form>
</body>


<script>
    $.post("http://www.baidu.com", function(data){
        alert(data);
    })

    $.ajax({
        url: "http://www.baidu.com",
        type: "POST",
        success: function (data) {
            alert(data);
        }
    })

    $("form").submit(function (envent)
    {
        var form = $(this);
        $.ajax({
            url: form.attr("action"),
            // type: form.attr("mathod"),
            data: form.serialize(),
            method: "POST",
            headers:{"Authorization":"Basic dGVzdDp0ZXN0"},
             beforeSend: function ()
            {

            },
            error: function ()
            {

            },
            complete:function () {

            },
            success: function (data)
            {
               alert(data);
            }
        });
    });




    // $(function(){
    //     $.ajax({
    //         type:"POST",
    //         data:$("form").serialize(),
    //         url:"http://120.76.173.248:9999/auth/oauth/token",
    //         dataType: "jsonp",
    //         jsonp: "callback",
    //         headers:{"Authorization":"Basic dGVzdDp0ZXN0"},
    //         success: function(msg){
    //             alert( "Data Saved: " + msg );
    //         }
    //     })
    //     // $.get("http://120.76.173.248:9999/uc/crm/api/captcha-code", function(data){
    //     //     alert(data);
    //     // })
    //     //
    //
    // })

</script>
</html>